package com.mallcloud.mall.admin.config;

import com.mallcloud.mall.common.sequence.builder.SnowflakeSeqBuilder;
import com.mallcloud.mall.common.sequence.properties.SequenceSnowflakeProperties;
import com.mallcloud.mall.common.sequence.sequence.Sequence;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 * 设置发号器生成规则
 */
@Configuration
public class SequenceConfig {

	@Bean
	public Sequence userNameSequence(SequenceSnowflakeProperties properties) {
		return SnowflakeSeqBuilder
				.create(properties)
				.build();
	}
}
